<?php

namespace App\Http\Controllers\Home;

use DB;
use Illuminate\Http\Request;
use EasyWeChat\Foundation\Application;
use App\Http\Controllers\Controller;
use App\Http\Controllers\QueryController;

use App\Http\Models\Post;
use App\Http\Models\Menu;
use App\Http\Models\Top;
use App\Http\Models\Page;

class PageController extends Controller {

    protected $query = null;

    public function __construct(){
        $this->query = new QueryController();
    }

    public function index($id){
        $page  = Page::where('id',$id)->first();
        if($page['type'] == 1){
            return view('home.page.embed',['page'=>$page,'query'=>$this->query]);
        }
        return view('home.page.index',['page'=>$page]);
    }


}
